package com.ibm.risk.irmp.base.auth.entity;


import com.ibm.risk.irmp.base.auth.vo.OrganizationVo;
import jakarta.persistence.*;
import lombok.Data;
import lombok.ToString;
import org.hibernate.annotations.BatchSize;

import java.util.List;

/**
 * 人事管理机构
 */
@Data
@ToString(callSuper = true)
@Entity
@Table(name = "ri_base_auth_mng_branch")
public class SystemMngBranch extends OrganizationVo {

    @OneToMany
    @JoinColumn(name = "parent_code", updatable = false, insertable = false)
    @BatchSize(size = 50)
    private List<SystemMngBranch> children;

    @ManyToOne
    @JoinColumn(name = "parent_code")
    private SystemMngBranch parent;
}
